Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix utf8.codes signature #696

Merged
merged 1 commit into from
Sep 13, 2023
Merged

fix utf8.codes signature #696

merged 1 commit into from
Sep 13, 2023

Conversation

fperrad
Copy link
Contributor

@fperrad fperrad commented Sep 9, 2023

the iterator returned by utf8.codes needs some arguments (when called outside a for loop)

$ cat codes.lua
local s = "foo"
local iter = utf8.codes(s)
print(iter(s))
print(iter(s, 1))
$ ./tl run codes.lua
1	102
2	111
$ ./tl check codes.lua
========================================
2 errors:
codes.lua:3:11: wrong number of arguments (given 1, expects 0)
codes.lua:4:11: wrong number of arguments (given 2, expects 0)

the iterator returned by `utf8.codes` needs some arguments (when called outside a `for` loop)

```
$ cat codes.lua
local s = "foo"
local iter = utf8.codes(s)
print(iter(s))
print(iter(s, 1))
$ ./tl run codes.lua
1	102
2	111
$ ./tl check codes.lua
========================================
2 errors:
codes.lua:3:11: wrong number of arguments (given 1, expects 0)
codes.lua:4:11: wrong number of arguments (given 2, expects 0)
```
@github-actions
Copy link

github-actions bot commented Sep 9, 2023

Teal Playground URL: https://696--teal-playground-preview.netlify.app

@hishamhm hishamhm merged commit 02dae8b into teal-language:master Sep 13, 2023
8 checks passed
@hishamhm
Copy link
Member

Thanks!!

@fperrad fperrad deleted the codes branch October 20, 2023 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants